removed unused list of conversions to foo
authorØyvind Kolås <ok@src.gnome.org>
Sun, 11 Sep 2005 10:46:59 +0000 (10:46 +0000)
committerØyvind Kolås <ok@src.gnome.org>
Sun, 11 Sep 2005 10:46:59 +0000 (10:46 +0000)
ChangeLog
babl/babl-classes.h
babl/babl-conversion.c
babl/babl-format.c
babl/babl-image.c
babl/babl-introspect.c
babl/babl-memory.c
babl/babl-model.c
babl/babl-sampling.c
babl/babl-sanity.c
babl/babl-type.c

index d24b9ffafb1bc1002d800f6753475e28b06015b0..e082475ccb2018c1c62ccac42cef5037b3921e9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-09-11  Øyvind Kolås  <pippin@gimp.org>
+
+       * babl/babl-classes.h: Removed unused list of conversions to
+       types/models/formats.
+
+       * babl/babl-conversion.c: (conversion_new):
+       * babl/babl-format.c: (each_babl_format_destroy), (format_new):
+       * babl/babl-image.c: (babl_image_from_linear):
+       * babl/babl-introspect.c: (item_conversions_introspect):
+       * babl/babl-memory.c: (babl_realloc):
+       * babl/babl-model.c: (each_babl_model_destroy), (model_new):
+       * babl/babl-sampling.c: (each_babl_sampling_destroy):
+       * babl/babl-sanity.c: (type_sanity), (model_sanity), (babl_sanity):
+       * babl/babl-type.c: (each_babl_type_destroy), (type_new):
+
 2005-09-09  Øyvind Kolås  <pippin@gimp.org>
 
        * docs/Makefile.am: set BABL_PATH to builddir for creating the
index 6e340bf54ff09cfda6b565ab72536944e54fc08a..7bdd4f9985bbb75ca87d65085651ceae7ca56dfd 100644 (file)
@@ -123,7 +123,6 @@ typedef struct
 {
   BablInstance     instance;
   BablConversion **from;  /*< NULL terminated list of conversions from class */
-  BablConversion **to;    /*< NULL terminated list of conversions to class   */
   int              bits;  /*< number of bits used to represent the data type
                             (initially restricted to a multiple of 8) */
   double           min_val;
@@ -151,7 +150,6 @@ typedef struct
 {
   BablInstance     instance;
   BablConversion **from; /*< NULL terminated list of conversions from class */
-  BablConversion **to;   /*< NULL terminated list of conversions to class   */
   int              horizontal;
   int              vertical;
   char             name[4];
@@ -170,7 +168,6 @@ typedef struct
 {
   BablInstance     instance;
   BablConversion **from; /*< NULL terminated list of conversions from class */
-  BablConversion **to;   /*< NULL terminated list of conversions to class   */
   int              components;
   BablComponent  **component;
   BablType       **type; /*< must be doubles, used here for convenience in code */
@@ -180,7 +177,6 @@ typedef struct
 {
   BablInstance     instance;
   BablConversion **from; /*< NULL terminated list of conversions from class */
-  BablConversion **to;   /*< NULL terminated list of conversions to class   */
   int              components;
   BablComponent  **component;
   BablType       **type;
index 7d419efa49c8c3c6f18b1dcc99f5f6f7e2cd2015..d308469fcd24ac19d9c24bf8775f372b16b7cf8b 100644 (file)
@@ -96,7 +96,6 @@ conversion_new (const char        *name,
   babl->conversion.processings = 0;
 
   babl_add_ptr_to_list ((void ***)&(source->type.from), babl);
-  babl_add_ptr_to_list ((void ***)&(destination->type.to), babl);
   
   return babl;
 }
index 56ad171296c1ee89bd5d729b4ff0467d490d46aa..45ffcf0723607cb2f30ca8ac803c0a8609c75c25 100644 (file)
@@ -28,7 +28,6 @@ each_babl_format_destroy (Babl *babl,
                           void *data)
 {
   babl_free (babl->format.from);
-  babl_free (babl->format.to);
   babl_free (babl);
 
   return 0;  /* continue iterating */
@@ -75,7 +74,6 @@ format_new (const char     *name,
                        sizeof (int)            * (components));
 
   babl->format.from      = NULL;
-  babl->format.to        = NULL;
   babl->format.component = ((void *)babl) + sizeof (BablFormat);
   babl->format.type      = ((void *)babl->format.component) + sizeof (BablComponent*) * (components);
   babl->format.sampling  = ((void *)babl->format.type)      + sizeof (BablType*) * (components);
index 853555400123af0491c0edb2d15de452cb88e12e..a8ecc6ecf8b9c1a3533189c6b0865368488bfb42 100644 (file)
@@ -68,11 +68,11 @@ image_new (BablFormat     *format,
 
 Babl *
 babl_image_from_linear (void  *buffer,
-                            Babl  *format)
+                        Babl  *format)
 {
   Babl          *babl;
-  BablModel     *model;
-  int            components;
+  BablModel     *model = NULL;
+  int            components = 0;
   int            i;
   BablComponent *component [BABL_MAX_COMPONENTS];
   BablSampling  *sampling  [BABL_MAX_COMPONENTS];
index d440bc4e5fd218fe4b34c8415a8e601c00ece437..685dbf10a0f5d105d409d827447dd102707b4673 100644 (file)
@@ -111,18 +111,6 @@ item_conversions_introspect (Babl *babl)
       ptr++;
     }
   
-  if (babl->type.to)
-    babl_log ("\t\tconversions to %s: %i",
-       babl->instance.name, list_length ((void **)(babl->type.to)));
-
-
-  ptr = (void **)babl->type.to;
-
-  while (ptr && NULL!=*ptr)
-    {
-      babl_log ("\t\t\t'%s'", ((Babl *)(*ptr))->instance.name);
-      ptr++;
-    }
 }
 
 static void
index 13e518c58f1086726f7d645c8fdd268c43a75ec6..b152f85d7e06c0677002f0e9245391088cedf7c2 100644 (file)
@@ -151,7 +151,7 @@ void *
 babl_realloc (void   *ptr,
               size_t  size)
 {
-  void *ret;
+  void *ret = NULL;
 
   if (!ptr)
     {
index 0b5faaafdefe46b3b359a4bdac8e1f8dc429a7a2..d3fa47844cf5846884d5c10ffb15b3cea5fc435f 100644 (file)
@@ -28,7 +28,6 @@ each_babl_model_destroy (Babl *babl,
                          void         *data)
 {
   babl_free (babl->model.from);
-  babl_free (babl->model.to);
   babl_free (babl);
   return 0;  /* continue iterating */
 }
@@ -73,7 +72,6 @@ model_new (const char     *name,
   memcpy (babl->model.component, component, sizeof (BablComponent*)*components);
 
   babl->model.from         = NULL;
-  babl->model.to           = NULL;
   return babl;
 }
 
index 13832df60d29ed9a14b128bcc79d8dea14bebb06..125da99e50ebc176a763610dddfda515a206adb9 100644 (file)
@@ -48,7 +48,6 @@ each_babl_sampling_destroy (Babl *babl,
                             void *data)
 {
   babl_free (babl->sampling.from);
-  babl_free (babl->sampling.to);
   return 0;  /* continue iterating */
 }
 
index bb84b0c8ce4cba4b42bb54213e22b21cf971260d..4f7c33e35e60ca1ea83ffa00b015250ce1ee664a 100644 (file)
@@ -29,7 +29,6 @@ foo (Babl *babl,
   return 0;
 }
 
-static Babl *babl_conversion_source      (Babl *babl);
 static Babl *babl_conversion_destination (Babl *babl);
 
 static int
@@ -63,29 +62,6 @@ type_sanity (Babl *babl,
                 babl->instance.name);
     }
 
-
-  ok = 0;
-  if (babl->type.to)
-    {
-      ptr = (void **) babl->type.to;
-
-      while (ptr && NULL!=*ptr)
-        {
-          if (babl_conversion_source ((Babl *)(*ptr)) == babl_type_id (BABL_DOUBLE))
-            {
-              ok = 1;
-              break;
-            }
-          ptr++;
-        }
-    }
-  if (!ok)
-    {
-      OK=0;
-      babl_log ("lack of sanity! type '%s' has no conversion from double",
-                babl->instance.name);
-    }
-
   return 0;
 }
 
@@ -121,29 +97,6 @@ model_sanity (Babl *babl,
                 babl->instance.name);
     }
 
-
-  ok = 0;
-  if (babl->model.to)
-    {
-      ptr = (void **) babl->model.to;
-
-      while (ptr && NULL!=*ptr)
-        {
-          if (babl_conversion_source ((Babl *)(*ptr)) == babl_model_id (BABL_RGBA))
-            {
-              ok = 1;
-              break;
-            }
-          ptr++;
-        }
-    }
-  if (!ok)
-    {
-      babl_log ("lack of sanity! model '%s' has no conversion from 'rgba'",
-                babl->instance.name);
-      OK=0;
-    }
-
   return 0;
 }
 
@@ -182,11 +135,6 @@ babl_sanity (void)
   return OK;
 }
 
-static Babl *babl_conversion_source (Babl *babl)
-{
-  return (Babl *)babl->conversion.source;
-}
-
 static Babl *babl_conversion_destination (Babl *babl)
 {
   return (Babl *)babl->conversion.destination;
index d08a4f32420e5762f734fd648d61b9f3400bbd20..9edeeeeef10bd2bc1f2606f85e4c270a730163b2 100644 (file)
@@ -29,7 +29,6 @@ each_babl_type_destroy (Babl *babl,
                         void *data)
 {
   babl_free (babl->type.from);
-  babl_free (babl->type.to);
   babl_free (babl);
   return 0;  /* continue iterating */
 }
@@ -52,7 +51,6 @@ type_new (const char  *name,
   strcpy (babl->instance.name, name);
   babl->type.bits     = bits;
   babl->type.from     = NULL;
-  babl->type.to       = NULL;
 
   return babl;
 }